import { instance, request } from "./request";

//新增商品
export const addProduct = (data) => {
  return instance({
    url: "/Product/addProduct",
    method: "post",
    data,
  });
};

//获取代号
export const getCountryAbbr = () => {
  return request({
    url: "/index/countryAbbr",
    method: "get",
  });
};

//获取列表
export const getProductList = () => {
  return instance({
    url: "/Product/productList",
    method: "get",
  });
};

//删除产品
export const deleteProduct = (data) => {
  return instance({
    url: "/Product/deleteProduct",
    method: "post",
    data,
  });
};

//修改产品
export const updateProduct = (data) => {
  return instance({
    url: "/Product/updateProduct",
    method: "post",
    data,
  });
};

//修改前获取数据
export const getUpdateInfo = (data) => {
  return instance({
    url: "/Product/getUpdateInfo",
    method: "post",
    data,
  });
};

//添加SKU
export const addProductSku = (data) => {
  return instance({
    url: "/Product/addProductSku",
    method: "post",
    data,
  });
};

//获取SKU列表
export const getProductSkuList = (data) => {
  return instance({
    url: "/Product/productSkuList",
    method: "post",
    data,
  });
};

//删除sku
export const deleteProductSku = (data) => {
  return instance({
    url: "/Product/deleteProductSku",
    method: "post",
    data,
  });
};

//修改sku
export const updateProductSku = (data) => {
  return instance({
    url: "/Product/updateProductSku",
    method: "post",
    data,
  });
};

//excel下单
export const skuForm = (data) => {
  return instance({
    url: "/Sku/skuForm",
    method: "post",
    data,
  });
};
